<div style="margin: 5px 0px;">


<?php 
$menuPath = '../content/menu.xml';

$lang= $_SESSION['lang'];
if ($_GET['lang']) {
    $lang = $_GET['lang'];
}

$menuItems = getMenuItems($menuPath, $lang);

$currentMenuPath = getCurrentMenuPath();
?>

<table class="menuItem" cellpadding="0" cellspacing="0" >
    <tr>
    <?php 
        $index = 0;
        $active = -1;
        foreach ( $menuItems as $key=>$val ) {

            $menuItemActive = "";

            if( $currentMenuPath == $APP_PATH.$val -> path ) {
                $menuItemActive = "Active";
                $active = $index;
            }
            
            $menuRightClass = "menuItemRight".$menuItemActive;
            $menuLeftClass = "menuItemLeft".$menuItemActive;
            $menuItemClass = "menuItem".$menuItemActive;

            if( $active == $index-1 ) {
               $menuLeftClass = $menuLeftClass."Next"; 
            }
            
            if( $index == 0 ) {
               $menuLeftClass = "menuItemFirstLeft".$menuItemActive;
            } else if( $index == sizeof($menuItems)-1 ) {
                $menuRightClass = "menuItemLastRight".$menuItemActive;
                $menuItemClass = "menuItemLast".$menuItemActive;
            }
            
    ?>
    <td class="<?php echo $menuLeftClass;?>">&nbsp;</td>
    <td class="<?php echo $menuItemClass;?>"><a href="<?php echo $APP_PATH.$val -> path;?>"><?php echo $val -> title;?></a></td>
    <td class="<?php echo $menuRightClass;?>">&nbsp;</td>
    <?php 
            $index++;        
        }
    ?>
    </tr>
</table>

</div>


